/**
 *
 * @author
 *
 */
class NewBall {
    public radius:number = 17;
    public vx:number = 0;
    public vy:number = 0;
    public idx:number = 0;

    public nextX:number = 0;
    public nextY:number = 0;

    public lastX:number = 0;
    public lastY:number = 0;
    public name:string = "";
    public isJindong:number = -1;//-1没有进洞，0-5进入的洞口
    public moc:number = 0.9997;
    public degree:number = 0;
    constructor(_idx:number) {
        this.idx = _idx;
        create3DBall(_idx);
    }
    /**速度衰减 */
    public startRoll()
    {
        this.vx = this.vx * this.moc;
        this.vy = this.vy * this.moc;

        if(Math.abs(this.vx)<0.04 && Math.abs(this.vy)<0.04)
        {
            this.moc -= 0.000001;
        }

        if(Math.abs(this.vx)<0.002 && Math.abs(this.vy)<0.002)
        {
            this.vx = 0;
            this.vy = 0;
        }
    }
}
